<template>
  <van-dialog
   @confirm="closeDialog"
   @cancel="close" v-model="showDialog"
    title="选择电影院"  show-cancel-button>
       <div class="list">
         <van-address-list
            v-model="chosenAddressId"
            :list="list"
            default-tag-text="默认"
            @add="onAdd"
            add-button-text="确认"
            >
            <template #item-bottom>
                  <van-divider />
            </template>
            </van-address-list>
       </div>
  </van-dialog>
</template>

<script>
import { mapState } from 'vuex'
import { citylist } from '@/api/citylist'
export default {
  name: 'DiaLog',
  data () {
    return {
      chosenAddressId: 1,
      list: []
    }
  },
  created () {
    this.getlist()
  },
  computed: {
    ...mapState({
      showDialog: state => state.showDialog
    })
  },
  mounted () {
  },
  methods: {
    getlist () {
      this.list = citylist(this.$store.state.city)
    },
    onAdd () {
      this.$store.commit('setShowDialog', false)
    },
    closeDialog () {
      this.$store.commit('setShowDialog', false)
    },
    close () {
      this.$store.commit('setShowDialog', false)
    }
  }
}
</script>

<style lang="less" scoped>
.list{
    ::v-deep .van-address-item__name,.van-address-item__address{
        font-size: 3.2vw;
    }
    ::v-deep .van-address-item__address{
      margin: 0;
    }
    ::v-deep .van-icon-edit:before {
        content: '';
    }
     ::v-deep .van-address-item__value{
        padding: 0;
     }
     ::v-deep .van-divider{
        margin: 2vw 0;
     }
     ::v-deep .van-address-list{
        padding-bottom: 3vw;
     }
    //  ::v-deep .van-address-item__tag{

    //  }
}
</style>
